<template>
  <div class="gengduoxx">
    <div class="head">创作引导</div>
    <!-- <div class="item" v-for="(item,index) in gonggaolist" :key="index">
      <div class="title">{{item.title}}</div>
      <div class="time">{{item.created_at}}</div>
    </div>-->

    <div class="nrr" v-if="list.length!=0">
      <div class="item" v-for="(item,index) in list" :key="index">
        <div class="biaoti">{{item.title}}</div>
        <div class="jianjie">{{item.content}}</div>
        <div class="leixing">
          <span style="color:#266AFF;" @click="todetails(item.id)">点击查看</span>
          
        </div>

        <img  class='dingwei' src="../assets/honghuo.png" alt="">
      </div>
    </div>

    <img v-if="list.length==0" class="juzhong" src="../assets/tixian/t5.png" alt />
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: ""
    };
  },
  methods: {
    getgonggao() {
      this.$get(
        // method: "get",
        "media/hairs/guide_list",
        {
          uqid: localStorage.getItem("uqid")
        }
      ).then(response => {
        console.log(response);
        if (response.error == "0") {
          // this.xiaoxilist = response.data;
          this.list = response.data;
        } else {
          this.$message({
            showClose: true,
            message: response.message,
            type: "error"
          });
        }
      });
    },
    todetails(id){
      this.$router.push({ path: "/index/gg_yd_details", query: {type:'yd',id:id} });
      this.$store.state.mianbaoxie=['乐讯号','创作引导详情',]
    }
  },
  mounted() {
    if(!localStorage.getItem('uqid')){
      this.$router.push({ path: "/login", query: {  } });
      return
    }
    this.$store.state.mianbaoxie = ["乐讯号", "主页", "更多公告"];
    this.getgonggao();
  }
};
</script>

<style  scoped>
.dingwei{
    position: absolute;
    top:14px;
    right: 14px;
}
.juzhong {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.biaoti {
  font-size: 16px;
  line-height: 22px;
  color: rgba(51, 51, 51, 1);
}
.jianjie {
  margin-top: 14px;
  font-size: 14px;
  line-height: 20px;
  color: rgba(92, 92, 92, 1);
}
.leixing {
  margin-top: 14px;
  font-size: 12px;
  line-height: 17px;
  color: rgba(178, 178, 178, 1);
}
.nrr {
  margin-top: 26px;
  width: 100%;
  padding: 0 0 0 26px;
}
.item {
    position: relative;
  width: 30%;
  height: 153px;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.06);
  opacity: 1;
  border-radius: 6px;
  float: left;
  margin-right: 18px;
  padding: 21px 23px;
  box-sizing: border-box;
}

.title {
  width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.head {
  font-size: 18px;
  color: rgba(51, 51, 51, 1);
  padding: 0 26px;
}
.gengduoxx {
  height: calc(100% - 118px);
  background: rgba(255, 255, 255, 1);
  padding: 26px 0;
  box-sizing: border-box;
  overflow: hidden;
  overflow-y: scroll;
  position: relative;
}

.gengduoxx::-webkit-scrollbar{
    display: none;
}
</style>